<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    	               "http://www.w3.org/TR/html4/loose.dtd">

<html>
	<head>
		<link href="Standard.css" rel="stylesheet" type="text/css">
	  	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	  	<title>Search</title>
	</head>
	<body>	
<%@ page import="java.util.*" %>
<%@ page import="jpa.*" %>
<%@ page import="javax.naming.*" %>
<%@include file="header.jsp" %>

<br />
		<div id="container">
			<div id="searchPane">
				<% String search = request.getParameter("searchString"); %>
				<form action="search.jsp">
			 		<label class="searchLabel">Search: </label><input type="text" name="searchString" id="password"/><br class="clearBoth"/>
			 		<input type="submit" value="Search" id="searchButton"/>
		 		</form>
			</div>
		
		
<%




List<Cache> caches = null;
caches = stateless.getAllCaches();	
int size = caches.size();
%>
<ul>
 <% 	
	    if(search != null)
	     {   
	    	//Change over to statelessBean method .getAllCachesLike("String");
     		for(int i = 0; i < size; i++)
	    	{     			     			
     			String name = caches.get(i).getCacheName(); 
     			
     			if(name.toUpperCase().contains(search.toUpperCase()))
     			{
     			%>
     			<li><a href="cachePage.jsp"><%=name%></a></li>
     			<%
     			}	 
	     	}	    	 	 
	    }		 
%>
</ul>		
			
		</div>		
		<div id="footer"></div>
	</body>
</html> 
